class Solution:
    def predictPartyVictory(self, senate: str) -> str:
        # active=[1] * len(senate)
        # while True:
        #     for i in range(len(senate)):
        #         if active[i]==1:
        #             offset=1
        #             if senate[i]=='D':
        #                 while (offset+i)%len(senate)!=i:
        #                     index=(i+offset)%len(senate)
        #                     if senate[index]=='R' and active[index]==1:
        #                         active[index]=0
        #                         break
        #                     offset+=1
        #                 if (offset+i)%len(senate)==i:
        #                     return 'Dire'
        #             else:
        #                 while (offset+i)%len(senate)!=i:
        #                     index=(i+offset)%len(senate)
        #                     if senate[index]=='D' and active[index]==1:
        #                         active[index]=0
        #                         break
        #                     offset+=1
        #                 if (offset+i)%len(senate)==i:
        #                     return 'Radiant'
        radiant=[]
        dire=[]
        for i,val in enumerate(senate):
            if val=='R':
                radiant.append(i)
            else:
                dire.append(i)
        while radiant and dire:
            if radiant[0]>dire[0]:
                dire.append(dire[0]+len(senate))
            else:
                radiant.append(radiant[0]+len(senate))
            radiant.pop(0)
            dire.pop(0)
        return 'Radiant' if radiant else 'Dire'



                #print(active)    

s=Solution()
print(s.predictPartyVictory('RD'))                              

'''
队列使用的不熟
'''